-
Notifications
You must be signed in to change notification settings - Fork 512
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add LCM to DIFFUSERS_TASKS_TO_MODEL_LOADERS #1762
Conversation
@echarlaix, can you please take a look? This is required for https://github.com/huggingface/optimum-intel/pull/618/files |
"stable-diffusion-xl": "StableDiffusionXLImg2ImgPipeline", | ||
"stable-diffusion-xl": "StableDiffusionXLPipeline", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
_optional_components
was introduced in diffusers v0.22.0 https://github.com/huggingface/diffusers/blob/v0.22.0/src/diffusers/pipelines/stable_diffusion_xl/pipeline_stable_diffusion_xl.py#L144, so we would need to upgrade DIFFUSERS_MINIMUM_VERSION
as well to avoid any potential issue when loading a SDXL model (which don't have optional components)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
DIFFUSERS_MINIMUM_VERSION was upgraded
"stable-diffusion-xl-refiner": "StableDiffusionXLImg2ImgPipeline", | ||
"latent-consistency": "LatentConsistencyModelPipeline", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you extend on why this is needed ? To my knowledge this shouldn't be needed (both pipelines can be correctly loaded using the current _DIFFUSERS_TASKS_TO_MODEL_LOADERS
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
also at the moment inferred task for diffusers
models will either be "stable-diffusion-xl" or "stable-diffusion"
optimum/optimum/exporters/tasks.py
Line 1564 in dedb852
inferred_task_name = "stable-diffusion-xl" if "StableDiffusionXL" in class_name else "stable-diffusion" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is necessary to correctly determine the model class from task. Hybrid quantization supports the stable-diffusion-xl
task, but doesn't support the stable-diffusion-xl-refiner
. Without these changes, it is not possible to apply hybrid quantization via CLI.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure that we need it in the TaskManager, from what I see it's only needed to get the class to load the model in the optimum-intel CLI for diffusers models, could we move it in optimum-intel directly instead ? We could get this information by combining the task (text-to-image, image-to-image, inpaint, ..) and the architecture (SD, SDXL, LCMs, ..) using the model's config
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are you suggesting to remove only the latent-consistency
from _DIFFUSERS_TASKS_TO_MODEL_LOADERS
?
As far as I understand, there are no text-to-image, image-to-image, inpaint,..
tasks in optimum. Should I create these tasks only for optimum-intel instead of stable-diffusion, stable-diffusion-xl, stable-diffusion-xl-refiner and latent-consistency
? In this case, we cann't use TasksManager.infer_task_from_model
for diffusion models.
3058da7
to
f36e61e
Compare
What does this PR do?
Relates to huggingface/optimum-intel#618
stable-diffusion-xl
mappinglatent-consistency
taskBefore submitting